package com.jr.service.impl;

import com.jr.mapper.UserMapper;
import com.jr.pojo.LUser;
import com.jr.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.beans.Transient;

@Service
public class UserServiceImpl implements IUserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean login(LUser u) {
        return userMapper.selectLUser(u)!=null;
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public boolean register(LUser u) {
        return userMapper.insertLUser(u)>0;
    }

    @Override
    public boolean updatePsw(LUser u) {
        return userMapper.updatePsw(u)>0;
    }
}
